package arithmetic.someAlgorithm;
/**
 * 找两个数组中相同元素的个数
 * @author lidd
 *
 */
public class FindSameNumCount {

	public static void main(String[] args) {
		int[] one = new int[] {1,3,5,7,9};
		int[] two = new int[] {2,3,5,7,10};
		int hh = find(one,two);

		System.out.print(hh);
	}

	public static int find(int[] one ,int[] two) {
		int count=0;

		for(int i=0; i<one.length; i++) {
			for(int j=0; j<two.length;j++) {
				if(one[i]<two[j])
					break;
				if(one[i]==two[j]) {
					count++;
				}
			}
		}

		return count;
	}
}
